Skip to content

fix(detector): detect generator send replay#43

Closed
prasannakotyal wants to merge 1 commit into
gpu-mode:mainfrom
prasannakotyal:prasannakotyal/kg-blue-75-generator-send-replay
Closed

fix(detector): detect generator send replay#43
prasannakotyal wants to merge 1 commit into
gpu-mode:mainfrom
prasannakotyal:prasannakotyal/kg-blue-75-generator-send-replay

Conversation

@prasannakotyal

Copy link
Copy Markdown

Summary

Targets KG red #75, where custom_kernel returns _g.send(data) from a module-level primed generator. The generator frame stores the first output and subsequent timed calls replay that saved value.

This adds a narrow GENERATOR_SEND_REPLAY detector. It requires:

  • a module-level generator object built from a function containing yield
  • explicit priming via next(g) or g.send(None)
  • an entrypoint return of g.send(<input parameter>)
  • yielded state assigned from the sent input behind an input-independent gate

The last condition keeps normal coroutine-style generators that compute on every send out of scope.

KernelGuard-Red-Submission: 75

Local verification

  • red_01_generator_replay -> GENERATOR_SEND_REPLAY, should_filter=True
  • clean_generator_helper -> stays valid
  • clean_coroutine_send -> stays valid
  • clean_unprimed_generator -> stays valid
  • python -m py_compile kernelguard.py

@prasannakotyal prasannakotyal temporarily deployed to kernelguard-api-control-plane May 1, 2026 18:41 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown

KernelGuard Blue Evaluation

@SinatrasC

Copy link
Copy Markdown
Collaborator

Thanks for the KernelGuard Flywheel Campaign contribution. This PR is now superseded by the consolidated rule-family implementation in #273, which folds this detector coverage together with the related passing-eval variants.

@SinatrasC SinatrasC closed this Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants